package data;

import org.apache.beam.sdk.coders.AvroCoder;
import org.apache.beam.sdk.coders.DefaultCoder;
import org.apache.kafka.common.protocol.types.Field;

import java.io.Serializable;

/**
 * Created by emily on 17-12-12.
 */

@DefaultCoder(AvroCoder.class)
public class DataPoint implements Serializable{
    public String sensorId;
    public Double value;
    public Long timestamp;

    public DataPoint(){

    }

    public DataPoint(String sensorId, String timestamp, String value){
        this.sensorId = sensorId;
        this.timestamp = Long.valueOf(timestamp);
        this.value = Double.valueOf(value);
    }

    public void setDataPoint(String sensorId, Long timestamp, Double value){
        this.sensorId = sensorId;
        this.timestamp = timestamp;
        this.value = value;
    }

}
